The invention relates to manipulating a time value.
Dates may be stored by a computer in an "mm/dd/yy" format (e.g., Feb. 1, 1996 stored as 02/01/96). The year value "96" is ambiguous with respect to the century intended, the "19" being assumed. For example, the computer may calculate a length of ownership interval to keep track of 10-year warranty periods for refrigerators sold. If a refrigerator bought on Feb. 1, 1992 (02/01/92) breaks down on May 7, 1996 (05/07/96), the calculation involves subtracting "92" from "96" to produce "4" as expected. However, when the same refrigerator breaks down on May 7, 2001, the computer mishandles keeping track of the associated warranty period, because then the calculation involves subtracting "92" from "01", which produces an erroneous result (such as "-91" or "91") or causes the computer to cease functioning properly. Such mishandling occurs for any breakdown date after Dec. 31, 1999.
The calculation is executed in accordance with machine code (i.e., computer instructions that are directly executable by the computer) derived by compiler software from source code (i.e., human-readable computer instructions formatted according to a computer language such as Common Business Oriented Language ("COBOL")). To prevent the mishandling described above, the source code may be altered to include "expansion" instructions so that "19" or "20" (i.e., the century intended) is stored and manipulated explicitly. Alternatively, such prevention may be accomplished by altering the source code to include "windowing logic" instructions to specify a predetermined interpretation of a two-digit year value (e.g., that year values correspond to a "window" of years ranging from 1950 through 2049). These source code alterations may be performed manually or by translator software that automatically includes the windowing logic instructions in the source code. The computer then executes in accordance with new machine code derived from the altered source code.